package com.cmc.cloud.cmclink.doc.api.document.rep;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;

/**
 * VMG信息 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@Valid
public class VgmBaseDto {

    @Schema(description = "提单号")
    @Length(max = 50, message = "{vgm.blno.length}")
    private String blNo;

    @Schema(description = "箱号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{vgm.cntrno.notblank}")
    @Length(max = 12, message = "{vgm.cntrno.length}")
    private String cntrNo;

    @Schema(description = "重量")
    @Min(value = 2200,message = "{VgmBaseVO.weight.min}")
    @Max(value = 35000,message = "{VgmBaseVO.weight.max}")
    private BigDecimal weight;

    @Schema(description = "称重方式")
    @Length(max = 3, message = "{vgm.typecode.length}")
    private String typeCode;

    @Schema(description = "称重地点")
    @Length(max = 100, message = "{vgm.address.length}")
    private String address;

    @Schema(description = "称重时间")
    private String time;

    @Schema(description = "验证签名")
    @Length(max = 100, message = "{vgm.signature.length}")
    private String signature;

    @Schema(description = "数据来源网厅web 、edi、api、手动manual")
    @Length(max = 20, message = "{vgm.datasource.length}")
    private String dataSource;

    @Schema(description = "文件id", example = "4508")
    private Long fileId;
}
